<template>
  <div class="detail">
    <div class="LF">
      <span> {{ LF }} </span>
    </div>

    <div class="list name">
      <div class="tital">
        <span>失物名</span>
      </div>
      <div class="messageDetail">
        {{ res.lostName }}
      </div>
    </div>
    <div class="list tel">
      <div class="tital">
        <span>联系方式</span>
      </div>
      <div class="messageDetail">
        {{ res.tel }}
      </div>
    </div>
    <div class="list des">
      <div class="tital">
        <span>描述</span>
      </div>
      <div class="messageDetail">
        {{ res.description }}
      </div>
    </div>
  </div>
</template>

<script>
import { getLostListByNo } from "@/api/api.js";

export default {
  data: function () {
    return {
      res: "",
      LF: "",
    };
  },
  methods: {},
  mounted: async function () {
    let result = await getLostListByNo(this.$route.params.no);
    // console.log(result.data.lostList[0]);
    this.res = result.data.lostList[0];

    if (this.res.LorF == "lost") {
      this.LF = "寻找失物";
    } else {
      this.LF = "寻找失主";
    }
  },
};
</script>

<style lang="less">
.detail {
  min-width: 7.5rem;
  min-height: 100vh;
  background-color: #f5f6fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  // justify-content: center;
  .list {
    width: 6rem;
    margin: 0.25rem 0;
    background-color: white;
    border-radius: 0.4rem;
    padding: 0rem 0.5rem 0rem 0.5rem;
    box-shadow: 0rem 0rem 0.1rem 0rem rgba(0, 0, 0, 0.1);
    &:nth-of-type(1) {
      margin-top: 0.5rem;
    }
    &:last-of-type{
      margin-bottom: 1.6rem;
    }
    display: flex;
    flex-direction: column;
    align-items: center;
    .tital {
      width: 5.5rem;
      color: #192a56;
      padding: 0.25rem 0.2rem 0.25rem 0.2rem;
      border-bottom: solid 0.01rem #7f8fa6;
      display: flex;
      justify-content: space-between;
      align-items: center;
      // height: 1rem;
      span {
        height: 0.4rem;
        font-weight: 700;
        font-size: 0.4rem;
        line-height: 0.4rem;
      }
    }
    .messageDetail {
      width: 6rem;
      font-size: 0.35rem;
      color: #273c75;
      padding: 0.2rem 0.4rem 0.3rem 0.4rem;
    }
  }
  .LF {
    width: 6rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    color: #192a56;
    font-weight: 700;
    font-size: 0.5rem;
    line-height: 0.5rem;
    display: flex;
    justify-content: center;
  }
}
</style>